


LOCAL_PATH := $(call my-dir)
LOCAL_ARM_MODE := arm
include $(CLEAR_VARS)



# The component relative path
APPFRAME_PATH := ../../../../app_frame/
COMPONENT_PATH := ../../../../components/
PLATFORM_PATH := ../../../../platform/android/
LOCAL_C_INCLUDES := ../openal/include ../openal/OpenAL32/Include $(COMPONENT_PATH)libmad

#################################################################################################
# Appframe source code
#################################################################################################
LOCAL_SRC_FILES := \
	$(APPFRAME_PATH)app_frame.cpp \
	$(APPFRAME_PATH)bitmap.cpp \
	$(APPFRAME_PATH)font_manager.cpp \
	$(APPFRAME_PATH)../core/base/basic_types.cpp \
	$(APPFRAME_PATH)../core/input/touch_event.cpp \
	$(APPFRAME_PATH)../core/audio/mp3_reader.cpp \
	$(APPFRAME_PATH)../core/audio/audio.cpp \
	$(APPFRAME_PATH)../core/audio/wav_reader.cpp \
	$(APPFRAME_PATH)unit_test.cpp
	
LOCAL_SRC_FILES += \
	$(PLATFORM_PATH)java_bridge.cpp \
	$(PLATFORM_PATH)timer.cpp \
	$(PLATFORM_PATH)texture.cpp \
	$(PLATFORM_PATH)render_item.cpp \
	$(PLATFORM_PATH)file_io.cpp

#################################################################################################
# Freetype source code
#################################################################################################
LOCAL_SRC_FILES += \
	$(COMPONENT_PATH)freetype/src/base/ftbbox.c \
	$(COMPONENT_PATH)freetype/src/base/ftbitmap.c \
	$(COMPONENT_PATH)freetype/src/base/ftglyph.c \
	$(COMPONENT_PATH)freetype/src/base/ftstroke.c \
	$(COMPONENT_PATH)freetype/src/base/ftxf86.c \
	$(COMPONENT_PATH)freetype/src/base/ftbase.c \
	$(COMPONENT_PATH)freetype/src/base/ftsystem.c \
	$(COMPONENT_PATH)freetype/src/base/ftinit.c \
	$(COMPONENT_PATH)freetype/src/base/ftgasp.c \
	$(COMPONENT_PATH)freetype/src/raster/raster.c \
	$(COMPONENT_PATH)freetype/src/sfnt/sfnt.c \
	$(COMPONENT_PATH)freetype/src/smooth/smooth.c \
	$(COMPONENT_PATH)freetype/src/autofit/autofit.c \
	$(COMPONENT_PATH)freetype/src/truetype/truetype.c \
	$(COMPONENT_PATH)freetype/src/cff/cff.c \
	$(COMPONENT_PATH)freetype/src/psnames/psnames.c \
	$(COMPONENT_PATH)freetype/src/pshinter/pshinter.c

LOCAL_CFLAGS += -W -DANDROID_BUILD
LOCAL_CFLAGS += -fPIC -DPIC
LOCAL_CFLAGS += -DDARWIN_NO_CARBON
LOCAL_CFLAGS += -DFT2_BUILD_LIBRARY

# enable the FreeType internal memory debugger in the simulator
# you need to define the FT2_DEBUG_MEMORY environment variable
# when running the program to activate it. It will dump memory
# statistics when FT_Done_FreeType is called
#
ifeq ($(TARGET_SIMULATOR),true)
LOCAL_CFLAGS += "-DFT_DEBUG_MEMORY"
endif


#################################################################################################
# nvmath source code
#################################################################################################	
LOCAL_SRC_FILES += \
	$(COMPONENT_PATH)math/Matnnt.cpp \
	$(COMPONENT_PATH)math/Quatt.cpp \
	$(COMPONENT_PATH)math/Trafo.cpp
	

#################################################################################################
# png source code
#################################################################################################	
LOCAL_SRC_FILES += \
	$(COMPONENT_PATH)png/png.c \
	$(COMPONENT_PATH)png/pngerror.c \
	$(COMPONENT_PATH)png/pngget.c \
	$(COMPONENT_PATH)png/pngmem.c    \
	$(COMPONENT_PATH)png/pngpread.c  \
	$(COMPONENT_PATH)png/pngread.c   \
	$(COMPONENT_PATH)png/pngrio.c    \
	$(COMPONENT_PATH)png/pngrtran.c  \
	$(COMPONENT_PATH)png/pngrutil.c  \
	$(COMPONENT_PATH)png/pngset.c    \
	$(COMPONENT_PATH)png/pngtrans.c  \
	$(COMPONENT_PATH)png/pngwio.c    \
	$(COMPONENT_PATH)png/pngwrite.c  \
	$(COMPONENT_PATH)png/pngwtran.c  \
	$(COMPONENT_PATH)png/pngwutil.c  


#################################################################################################
# zlib source code
#################################################################################################
LOCAL_SRC_FILES += \
  	$(COMPONENT_PATH)zlib/adler32.c  \
	$(COMPONENT_PATH)zlib/crc32.c    \
	$(COMPONENT_PATH)zlib/deflate.c  \
	$(COMPONENT_PATH)zlib/gzclose.c  \
	$(COMPONENT_PATH)zlib/gzlib.c    \
	$(COMPONENT_PATH)zlib/gzread.c   \
	$(COMPONENT_PATH)zlib/gzwrite.c  \
	$(COMPONENT_PATH)zlib/infback.c  \
	$(COMPONENT_PATH)zlib/inffast.c  \
	$(COMPONENT_PATH)zlib/inflate.c  \
	$(COMPONENT_PATH)zlib/inftrees.c \
	$(COMPONENT_PATH)zlib/trees.c    \
	$(COMPONENT_PATH)zlib/uncompr.c  \
	$(COMPONENT_PATH)zlib/zutil.c

#################################################################################################
# libmad source code
#################################################################################################	
LOCAL_CFLAGS += -DHAVE_CONFIG_H -DFPM_DEFAULT -ffast-math
LOCAL_SRC_FILES += \
  	$(COMPONENT_PATH)libmad/bit.c  \
	$(COMPONENT_PATH)libmad/decoder.c    \
	$(COMPONENT_PATH)libmad/fixed.c  \
	$(COMPONENT_PATH)libmad/frame.c  \
	$(COMPONENT_PATH)libmad/huffman.c  \
	$(COMPONENT_PATH)libmad/layer12.c  \
	$(COMPONENT_PATH)libmad/layer3.c  \
	$(COMPONENT_PATH)libmad/stream.c  \
	$(COMPONENT_PATH)libmad/synth.c  \
	$(COMPONENT_PATH)libmad/timer.c 
	
#################################################################################################
# OpenAL source code
#################################################################################################	
LOCAL_CFLAGS += -DAL_BUILD_LIBRARY -DAL_ALEXT_PROTOTYPES	
LOCAL_SRC_FILES += \
	../openal/OpenAL32/alAuxEffectSlot.c \
	../openal/OpenAL32/alBuffer.c        \
	../openal/OpenAL32/alDatabuffer.c    \
	../openal/OpenAL32/alEffect.c        \
	../openal/OpenAL32/alError.c         \
	../openal/OpenAL32/alExtension.c     \
	../openal/OpenAL32/alFilter.c        \
	../openal/OpenAL32/alListener.c      \
	../openal/OpenAL32/alSource.c        \
	../openal/OpenAL32/alState.c         \
	../openal/OpenAL32/alThunk.c         \
	../openal/Alc/ALc.c                  \
	../openal/Alc/alcConfig.c            \
	../openal/Alc/alcEcho.c              \
	../openal/Alc/alcModulator.c         \
	../openal/Alc/alcReverb.c            \
	../openal/Alc/alcRing.c              \
	../openal/Alc/alcThread.c            \
	../openal/Alc/ALu.c                  \
	../openal/Alc/android.c              \
	../openal/Alc/bs2b.c                 \
	../openal/Alc/null.c                 

LOCAL_C_INCLUDES += \
	$(LOCAL_PATH)/$(COMPONENT_PATH)freetype/builds \
	$(LOCAL_PATH)/$(COMPONENT_PATH)freetype/include \
	$(LOCAL_PATH)/$(COMPONENT_PATH)math \
	$(LOCAL_PATH)/$(COMPONENT_PATH)png \
	$(LOCAL_PATH)/$(COMPONENT_PATH)zlib \
	$(LOCAL_PATH)/$(COMPONENT_PATH)libz


LOCAL_CFLAGS += -O2

# Link to GLES
LOCAL_LDLIBS += -lGLESv1_CM -llog
# For AssetManager
LOCAL_LDLIBS += -landroid

LOCAL_MODULE := libknyet

include $(BUILD_SHARED_LIBRARY)


